//
//  ShopView.m
//  Ghac 4S
//
//  Created by apple on 11-9-15.
//  Copyright (c) 2011年 __MyCompanyName__. All rights reserved.
//

#import "ShopView.h"
#import "Shop.h"
@implementation ShopView
@synthesize nameLabel;
@synthesize phoneLabel;
@synthesize cityLabel;
@synthesize provinceLabel;
@synthesize addressLabel;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}
-(void)setSource:(Shop *)shop
{
    [m_shop release];
    m_shop = [shop retain];
    NSLog(@"set %@", shop);
}
-(void)reloadData
{
    self.nameLabel.text = m_shop.name;
    self.addressLabel.text = m_shop.address;
    self.provinceLabel.text = m_shop.province;
    self.cityLabel.text = m_shop.city;
    self.phoneLabel.text = m_shop.phone;
    
    NSLog(@"reload %@", m_shop);
    
}
- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self reloadData];
}


- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
